package com.yh.lq.entity;

import lombok.Getter;

import java.util.Arrays;

public enum ImType {
    QQ(1, "QQ"),
    WE_CHAT(2, "微信"),
    ;

    @Getter
    private int index;
    @Getter
    private String desc;

    ImType(int index, String desc) {
        this.index = index;
        this.desc = desc;
    }

    public static ImType getByIndex(Integer index) {
        return Arrays.stream(values())
                .filter(i -> i.getIndex() == index).findFirst()
                .orElse(null);
    }
}
